<template>
  <!-- 全屏的插件 -->
  <div>
    <svg-icon icon-class="fullscreen" style="color:#fff; width: 20px; height: 20px" @click="changeScreen" />
  </div>
</template>

<script>
import ScreenFull from 'screenfull'
export default {
  name: 'ScreenFull',
  methods: {
    changeScreen () {
      if (!ScreenFull.isEnabled) {
        // 此时全屏不可用
        this.$message.warning('此时全屏不可用')
      }
      // document.documentElement.requestFullscreen()  原生js调用
      ScreenFull.toggle()
    }
  }

}
</script>

<style>

</style>
